Platform Explorer / Nuxeo Platform 2023.22

Operation Document.AddEntryToMultivaluedProperty (Add entry into multi-valued metadata)

Description

Add value into the field expressed by the xpath parameter. This field must be a multivalued metadata.

'checkExists' parameter enables to add value only if doesn't already exists in the field:

  • if checked, the value will not be added if it exists already in the list
  • if not checked the value will be always added.

    Remark: only works for a field that stores a list of scalars (string, boolean, date, int, long) and not list of complex types.

    Save parameter automatically saves the document in the database. It has to be turned off when this operation is used in the context of the empty document created, about to create, before document modification, document modified events.

Operation id Document.AddEntryToMultivaluedProperty
AliasesAddEntryToMultivaluedPropertyDocumentMultivaluedProperty.addItem
Category Document
Label Add entry into multi-valued metadata
Requires
Since

Parameters

Name Description Type Required Default value
value serializable yes  
xpath string yes  
checkExists boolean no true 
save boolean no true 

Signature

Inputs document, documents
Outputs document, documents

Implementation Information

Implementation Class Class: org.nuxeo.ecm.automation.core.operations.document.AddEntryToMultiValuedProperty
Contributing Component org.nuxeo.ecm.core.automation.coreContrib

JSON Definition

{
  "id" : "Document.AddEntryToMultivaluedProperty",
  "aliases" : [ "AddEntryToMultivaluedProperty", "DocumentMultivaluedProperty.addItem" ],
  "label" : "Add entry into multi-valued metadata",
  "category" : "Document",
  "requires" : null,
  "description" : "Add value into the field expressed by the xpath parameter. This field must be a multivalued metadata.<p> 'checkExists' parameter enables to add value only if doesn't already exists in the field: <ul><li> if checked, the value will not be added if it exists already in the list</li><li>if not checked the value will be always added</li</ul>.<p> Remark: <b>only works for a field that stores a list of scalars (string, boolean, date, int, long) and not list of complex types.</b></p><p>Save parameter automatically saves the document in the database. It has to be turned off when this operation is used in the context of the empty document created, about to create, before document modification, document modified events.</p>",
  "url" : "Document.AddEntryToMultivaluedProperty",
  "signature" : [ "document", "document", "documents", "documents" ],
  "params" : [ {
    "name" : "value",
    "description" : null,
    "type" : "serializable",
    "required" : true,
    "widget" : null,
    "order" : 0,
    "values" : [ ]
  }, {
    "name" : "xpath",
    "description" : null,
    "type" : "string",
    "required" : true,
    "widget" : null,
    "order" : 0,
    "values" : [ ]
  }, {
    "name" : "checkExists",
    "description" : null,
    "type" : "boolean",
    "required" : false,
    "widget" : null,
    "order" : 0,
    "values" : [ "true" ]
  }, {
    "name" : "save",
    "description" : null,
    "type" : "boolean",
    "required" : false,
    "widget" : null,
    "order" : 0,
    "values" : [ "true" ]
  } ]
}